package com.bsfcs.rag;

import com.bsfcs.rag.manager.IContractManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class CacheDataLoader implements CommandLineRunner {
    private static final Logger logger = LoggerFactory.getLogger(CacheDataLoader.class);

    @Autowired
    private IContractManager contractManager;

    @Override
    public void run(String... args) {
        contractManager.cachePaymentMethod();
        logger.info("缓存支付方式完成...");
        contractManager.cacheIndustry();
        logger.info("缓存行业完成...");
        contractManager.cacheCounterpart();
        logger.info("缓存客户完成...");
    }
}
